﻿@model SalesOrders
@section ToolBar{
    <div class="r-c-tool">
        <a href="javascript:location.reload();" class="l-btn fa fa-refresh"></a>
        <a href="javascript:void(0);" class="l-btn fa fa-search"></a>
    </div>
    <div class="r-c-list">
        @Html.LActionLink("新建销售出库单", "Edit", "SalesOrder", new { }, new { @class = "l-btn" })
        @Html.ActionLink("草稿", "Index", "SalesOrder", new { t = 1}, new { @class = "l-btn" })
        @Html.ActionLink("未交货", "Index", "SalesOrder", new { t = 2}, new { @class = "l-btn"})
        @Html.ActionLink("未结款", "Index", "SalesOrder", new { t = 3}, new { @class = "l-btn"})
        @Html.ActionLink("已结束", "Index", "SalesOrder", new { t = 4}, new { @class = "l-btn"})
        @Html.ActionLink("全部订单", "Index", "SalesOrder", new { t = 0}, new { @class = "l-btn cur"})
    </div>
    @*<div class="r-c-search fr">
        <label class="relative fl">
            <input class="inp-text bc1" type="text" /><a href="javascript:void(0)" class="fa fa-search absolute c5"></a>
        </label>
        <a href="javascript:void(0)" class="senior-search fl">高级<br />搜索</a>
    </div>*@
}
<div class="l-m-table">
    <table>
        <tr class="bgc3">
            <th>销售单号</th>
            <th>客户</th>
            <th>业务员</th>
            <th>收货地址</th>
            <th>收货人</th>
            <th>联系电话</th>
            <th>金额(元)</th>
            <th>配送状态</th>
            <th>结款状态</th>
            <th>操作</th>
        </tr>
        @if (Model==null || Model.Items.Count <= 0) {
            <tr>
                <td colspan="11" class="t-c c0">暂无记录</td>
            </tr>
        }
        @foreach (SalesOrder c in Model.Items)
        {
            <tr>
                <td>@Html.LActionLink(c.SalesOrderNo, "Detail", "SalesOrder", new { id = c.SalesOrderId })</td>
                <td>@c.Customer.CustomerName</td>
                <td>@(c.OrderEmployee == null? "" : c.OrderEmployee.EmployeeName)</td>
                <td>@c.Address</td>
                <td>@c.ContactName</td>
                <td>@c.Phone </td>
                <td>@c.ActualAmount.MoneyFormat()</td>
                <td>@CommonFun.GetDeliveryStatus(c.DeliveryStatusId,c.DeliveryTypeId)</td>
                <td>@c.SettleStatusId.GetEnumDescription()</td>
                <td>
                    @Html.LActionLink("修改", "Edit", "SalesOrder", new { id = c.SalesOrderId }, new { single = "single" })
                    @Html.LAjaxPost("删除", new { id = c.SalesOrderId, url = Url.Action("Delete", "SalesOrder"), callback = "callbackRemoveTr", tag = "delete" })
                </td>
            </tr>
        }
    </table>
</div>
@section Pager{
    @Html.Pager("Index", "SalesOrder", Model.TotalCount, (int)ViewBag.PageIndex, 20)
}